package com.tensquare.qa.dao;

import com.tensquare.qa.pojo.Problem;
import entity.PageResult;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface ProblemDao extends JpaRepository<Problem,String>, JpaSpecificationExecutor<Problem> {
    @Query(nativeQuery=true,value="select * from tb_pl,tb_problem where id=problemid and labelid=?1 order by createtime desc")
    Page<Problem> newlist(String labelId, Pageable pageable);
    @Query(nativeQuery=true,value="select * from tb_problem,tb_pl where id=problemid and labelid=?1 order by reply desc")
    Page<Problem> hotlist(String labelId, Pageable pageable);
}
